package com.woniuxy.JDKproxy;

import com.woniuxy.JDKproxy.jdk.JdkProxy;
import com.woniuxy.JDKproxy.service.RbacManagerService;
import com.woniuxy.JDKproxy.service.RbacRoleService;
import com.woniuxy.JDKproxy.service.impl.RbacManagerServiceImpl;
import com.woniuxy.JDKproxy.service.impl.RbacRoleServiceImpl;

public class TestJdkProxy {
    public static void main(String[] args) {
        JdkProxy jdkProxy = new JdkProxy();
        //创建目标类
//        RbacManagerService rbacManagerService = new RbacManagerServiceImpl();
        RbacRoleService rbacRoleService = new RbacRoleServiceImpl();
        //动态生成被代理的对象

        RbacRoleService proxyProxyOject = (RbacRoleService) jdkProxy.getProxyOject(rbacRoleService);
        //执行，新的 经过增强后的 代理对象的方法
        proxyProxyOject.findAll();
        int i = proxyProxyOject.removeOne(1);
    }
}
